﻿using PrjAssessModels.BaseModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PrjAssessModels
{
    public class ContentItem : BaseEntity
    {
        public ContentItem()
        {
            Items = new List<MaterialBuryItem>();
        }
        public List<MaterialBuryItem> Items { get; set; }
        public string ContentName { get; set; }
        public int Count
        {
            get
            {
                return this.Items.Count;
            }
        }
        public int Number
        {
            get
            {
                int sum = this.Items.Sum(p => p.Number);
                return sum;
            }
        }

        public double Sum
        {
            get
            {
                double sum = this.Items.Sum(p => p.MaterialTotal + p.BuryPrice);
                return sum;
            }
        }

    }
}
